Field of the Invention
The present invention relates to processing to interpret print data.
Description of the Related Art
A printing apparatus interprets print data (PDL data) described in a page description language (PDL) and temporarily generates intermediate data based on interpretation results. Then, the printing apparatus generates an image from the intermediate data and prints the generated image. Japanese Patent Laid-Open No. 2013-14039 has disclosed a printing apparatus that parallelly interprets individual pages in print data and generates intermediate data.
In the case where individual pages in the print data are interpreted parallelly, a plurality of data interpretation units configured to parallelly interpret pages and a control unit configured to notify the plurality of data interpretation units of pages for which intermediate data should be generated are made use of. Specifically, following the start of a print job, each data interpretation unit starts to interpret print data in order from the top page and manages the number of already interpreted pages. On the other hand, the control unit notifies each data interpretation unit of each individual page number for which intermediate data should be generated while incrementing the number of a page (page number) for which intermediate data should be generated in the order of 1, 2, 3, . . . from the start of the print job. For example, the control unit notifies a certain data interpretation unit of the page number “1”, and then notifies the next data interpretation unit of the page number “2”. Then, on the completion of the interpretation of a certain page, each data interpretation unit generates intermediate data of the page in the case where the number of already interpreted pages managed by each data interpretation unit itself and the notified page number coincide with each other. Then, the page for which intermediate data is generated is printed.
In print data, there exists a command to reset the number of already interpreted pages managed by a data interpretation unit even on the way of a print job. An example of such a command is startjob in PostScript (registered trademark). The command such as this is called a page reset command. On detecting (interpreting) a page reset command, the data interpretation unit resets the number of already interpreted pages managed by the data interpretation unit itself to “0”. The number of already interpreted pages described here refers to a page counter within the data interpretation unit and the value of the page counter is used for printing the number of pages in accordance with the setting of the printing apparatus. For example, by resetting the number of pages, it is made possible to allocate the same page number to individual pages within the same print job. For example, by including the page reset command in the second page of the print data, it is made possible to allocate the page number “1” to the first page of the print data and the page including the page reset command (i.e., the second page of the print data).
In the case where the above-described page reset command is included in the print data, with a printing apparatus using a conventional data interpretation unit and a control unit, such a problem occurs that a page including the page reset command is not printed. In the conventional data interpretation unit, in the case where a page including the page reset command is interpreted, the number of already interpreted pages managed by the data interpretation unit is reset to “0”. However, the control unit does not grasp this and notifies the data interpretation unit of the page number for which intermediate data should be generated. As a result of this, there occurs inconsistency between the page number notified by the control unit in order to cause a certain data interpretation unit to generate intermediate data and the number of already interpreted pages managed by the data interpretation unit itself, resulting in that the page including the page reset command is not printed. For example, the control unit notifies a data interpretation unit X of the page number “2” in order to cause the data interpretation unit X to generate intermediate data of the second page of the print data. Here, in the case where the page reset command is included in the second page of the print data, the number of already interpreted pages managed by the data interpretation unit X is reset to “0” at the time of detecting the page reset command. Then, the data interpretation unit X starts interpretation of the second page of the print data that follows the page reset command. However, the number of already interpreted pages managed by the data interpretation unit X has been reset, and therefore, at the time of the completion of the interpretation of the second page of the print data, the number of already interpreted pages managed by the data interpretation unit X is “1”, not “2”. Because of this, the number of already interpreted pages “1” does not coincide with the notified page number “2” notified by the control unit, and therefore, the intermediate data of the second page of the print data is not generated. As a result of this, the second page of the print data is not printed.